const files = require.context("@/components/codeList", true, /\.js$/);
let codeList = {}; //通过key取值
//icon
let iconList = {
  template: "el-icon-s-home",
  "element/": "el-icon-eleme",
  "iview/": "ivu-icon ivu-icon-logo-vimeo"
};

files.keys().forEach(filePath => {
  let key = filePath.substring(2, filePath.lastIndexOf("."));
  // codeList
  if (key !== "index") codeList[key] = files(filePath).default;
});

export { codeList, iconList };
